package sctu.edu.java.year2016.team07.shihaocheng.day20160522.chapter6_1;

/**
 * Created by admin on 2016/5/23.
 *判断字符串"mingrikejijavabu"中的i出现了几次，并将结果输出
 */
public class    Chapter6_1 {
    public static void main(String[] args) {
        String s="mingrikejijavabu";
        String S=s;
        int team=0;
        while(s.indexOf("i")!=-1){
            s=s.replaceFirst("i","");
            team++;
        }

        System.out.println(S+"中有"+team+"个i");
    }
}
